-
Notifications
You must be signed in to change notification settings - Fork 3.8k
TRUNK-5881: Order Domain - Switching from Hibernate Mappings to Annotations #4996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajeyprasand Thanks for the PR, this implantation is not completed you have to remove existing xml mapping and update test.
please refer this PRs: 335c2b5
@ManojLL I have updated the changes as requested. Do check and share your feedback |
@ajeyprasand some changes are not directly related to the scope of this JIRA ticket |
is it out of order domain? but in the order hibernate xml file, it had configurations for drug order, referral order, test order. and I cant find tickets for these too. @ManojLL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to create annotations for the Order Domain only and keep the rest as it is. These changes should include creating annotations for the Order Domain, deleting the Order hibernate config file, removing the hibernate mapping, and adding a test for the Order Domain.
Oh, okay. I got a bit confused because there was no hibernate xml file for DrugOrder, etc and the hibernate xml file for Order had the configurations for them. So, I initially thought that deleting the Order XML file might result in data loss, which is why I went ahead and added Hibernate annotations for them. But now, I've removed those annotations. Please take a look and let me know @rishabhrawat05 @ManojLL |
@@ -58,7 +58,7 @@ public void setUp() throws Exception { | |||
o = new Order(); | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all the changes from this file
@@ -60,6 +60,7 @@ | |||
import org.openmrs.ProgramAttributeType; | |||
import org.openmrs.Provider; | |||
import org.openmrs.ProviderAttributeType; | |||
import org.openmrs.ReferralOrder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this import statement of ReferralOrder
@@ -9,12 +9,15 @@ | |||
*/ | |||
package org.openmrs; | |||
|
|||
import javax.persistence.MappedSuperclass; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all the changes from this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rishabhrawat05 do I also have to add getter and setter for "attributes" of type Set which is a field newly added, and include it in copyHelper and cloneForRevision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rishabhrawat05 do I also have to add getter and setter for "attributes" of type Set which is a field newly added, and include it in copyHelper and cloneForRevision?
No, I think there is no need for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rishabhrawat05 okk. Do review the pr now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ManojLL can you review this
@ajeyprasand There is a build failure, could you please take a look? |
@ManojLL @rishabhrawat05 According to the logs |
@ManojLL @rishabhrawat05 but If I revert the changes to "added required changes" commit and modify a little more, its working fine |
TRUNK-5881: Order Domain - Switching from Hibernate Mappings to Annotations
Description of what I changed
Modified Order.java
Added java annotations by referring Order.hbm.xml
Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-5881
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master